﻿package mortal.game.view.lotteryDraw
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.forging.view.*;

    public class lotteryDrawPackageCellRender extends GCellRenderer
    {
        private var _item:DecomposePackItem;

        public function lotteryDrawPackageCellRender()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._item = UICompomentPool.getUICompoment(DecomposePackItem);
            this._item.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            this._item.isDragAble = false;
            this._item.x = 3;
            this._item.y = 3;
            this.addChild(this._item);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._item.dispose(param1);
            this._item = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:ItemData = null;
            super.data = param1;
            if (param1 is ItemData)
            {
                _loc_2 = param1 as ItemData;
                this._item.itemData = _loc_2;
                this._item.canNotUse = false;
                this._item.updateStrengLevel();
            }
            else
            {
                this._item.itemData = null;
                this._item.canNotUse = false;
                this._item.clearStrengLevel();
            }
            return;
        }// end function

    }
}
